﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;

namespace SkillSystem
{
    public class ComboSkillItemLinker : SkillItemLinkerBase
    {
        public int HitCount { get { return _hitCount; } set { _hitCount = value; } }

        int _hitCount;

        bool isFirstTrigered = true;
        public override bool IsCanLinkToNextItem()
        {
            bool isOK = _hitCount > 0;
            if (!isOK)
            {
                isFirstTrigered = true;
            }
            return isOK;
        }

        public override void OnSkillItemCompleted()
        {
            HitCount = 0;
        }

        public override void Do()
        {
            if (isFirstTrigered)
            {
                isFirstTrigered = false;
                HitCount = -1;
            }
            HitCount++;
        }
    }
}
